package com.woniuxy.article.mapper;/**
 * @Description：
 * @Author：曹杰克
 * @CreateTime：2022/10/19 20:01
 */

import com.hc.entity.Area;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 *@Description：文章分区表
 *@CreateTime：2022/10/19 20:01
 *@Author：曹杰克
 */
@Mapper
public interface AreaMapper {
    /**
     * 根据id获取文章分区信息
     * @param areaId
     * @return
     */
    @Select("select * from hc_area where id=#{areaId}")
    Area getById(int areaId);

    @Select("select count(*) from hc_area where status='y' and Paper_Id=#{PaperId}")
    int getAgreeNumByPaperId(int PaperId);

    @Select("select count(*) from hc_area where status='n' and Paper_Id=#{PaperId}")
    int getDisAgreeNumByPaperId(int PaperId);
}
